Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 6, 2026

Introduces a consolidated 5-phase PR agent workflow that provides structured, end-to-end assistance for investigating issues, developing fixes, and creating pull requests.

PR Agent Workflow

The new pr agent replaces the separate issue-resolver and pr-reviewer agents with a unified 5-phase workflow:

  1. Pre-Flight - Context gathering and state file creation
  2. Tests - Create or verify reproduction tests using the write-tests skill
  3. Gate - Verify tests catch the issue (mandatory checkpoint before proceeding)
  4. Fix - Explore and test fix approaches using the try-fix skill
  5. Report - Present findings and create PR (with explicit user confirmation)

Agent Changes

  • Removed: issue-resolver.md, pr-reviewer.md
  • Added: pr.md - Main agent with phases 1-3 (Pre-Flight, Tests, Gate)
  • Added: pr/post-gate.md - Phases 4-5 (Fix, Report)

New Skills

  • try-fix/ - Proposes ONE independent fix approach per invocation, applies it, runs tests, records result with failure analysis, then reverts. Learns from prior attempts. Max 5 attempts per session.
  • verify-tests-fail-without-fix/ - Auto-detects fix files from git diff, verifies tests FAIL without fix and PASS with fix
  • write-tests/ - Creates UI test pages and NUnit tests following MAUI conventions, with verification that tests reproduce the bug

New Instructions

  • agents.instructions.md - Copilot CLI agent authoring guidelines (constraints, best practices, anti-patterns)
  • skills.instructions.md - Skill development standards (structure, naming, script organization)

Script Updates

  • Added -Rebuild parameter to BuildAndRunHostApp.ps1 and Build-AndDeploy.ps1 for clean builds during test verification

Documentation Updates

  • Updated references from issue-resolver/pr-reviewer to pr agent across README-AI.md, copilot-instructions.md, sandbox.instructions.md, uitest-coding-agent.md
  • Expanded collectionview-handler-detection.instructions.md with platform-specific guidance (Items2/ is iOS/MacCatalyst only, Items/ is the only Android/Windows implementation)
Original prompt

Create a PR with all the changes from this PR on the PureWeen fork PureWeen#9


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Merge changes from PR #9 on PureWeen fork Port PR agent workflow from PureWeen/maui#9 Jan 6, 2026
Copilot AI requested a review from PureWeen January 6, 2026 16:01
@PureWeen
Copy link
Member

PureWeen commented Jan 6, 2026

@copilot update the title and description to be more accurate describing the purpose of this PR

It's fine to not reference the original PureWeen PR
This is now a separate PR that doesn't need to reference the original PR

Copy link
Contributor Author

Copilot AI commented Jan 6, 2026

@copilot update the title and description to be more accurate describing the purpose of this PR

It's fine to not reference the original PureWeen PR
...

Updated the PR description to be standalone and more accurately describe the purpose: introduces a consolidated 7-phase PR agent workflow, new skills for test verification and test writing, new instruction files for agent/skill development, and script enhancements.

Note: I can only update the PR description, not the title. Please update the title to something like "Introduce consolidated 7-phase PR agent workflow" or similar.

Copilot AI changed the title Port PR agent workflow from PureWeen/maui#9 Introduce consolidated 7-phase PR agent workflow Jan 6, 2026
**If starting from a PR:**
```bash
# Checkout the PR
git fetch origin pull/XXXXX/head:pr-XXXXX
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For future - we should keep in mind that when an agent switches branches, it may not have access to the latest agent skills or helper files available from the branch the review has been started

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine for now. This is just a weird state where it doesn't exist on main so it has issues. For cases where we start iterating on the agent after merge this won't really be a problem anymore. Like if you are fixing the agent with a PR review you'd just fix the agent while working on that PR then probably create a separate PR with agent fixes.

3. **Push and create PR**:
```bash
git push -u origin fix/issue-XXXXX
gh pr create --title "Fix #XXXXX: [Title]" --body "Fixes #XXXXX
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or if automatic PR creation is intended then can we title it "[PR-agent] Fix #XXXXX: [Title]"?

@@ -0,0 +1,202 @@
---
name: write-tests
description: Creates UI tests for a GitHub issue and verifies they reproduce the bug. Iterates until tests actually fail (proving they catch the issue). Use when PR lacks tests or tests need to be created for an issue.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This skill is meant to create a UI test. Shouldn’t it apply to both UI and unit tests and decide which one is more appropriate before creating either?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea, it should be both but for version one here and to not just keep iterating endlessly :-) I just have it writing UItests for now

And then once this is merged in someone ;-) can work on improving this skill independently

- Add try-fix skill for iterative fix exploration (generic, not agent-specific)
- Reduce from 7 phases to 5: Pre-Flight, Tests, Gate, Fix, Report
- Remove Validate phase (merged into Fix)
- Replace Analysis/Compare/Regression with try-fix loop
- Fix phase loops try-fix skill (max 5 candidates) to explore alternatives
- Add Fix Candidates table to state file template
- PR's fix becomes Candidate #1, alternatives explored automatically
- Add user confirmation before PR creation
- Update copilot-instructions.md with new agent description
@PureWeen PureWeen force-pushed the copilot/merge-changes-from-pr-9 branch from 3f6375a to 9c09f96 Compare January 6, 2026 22:57
@PureWeen PureWeen force-pushed the copilot/merge-changes-from-pr-9 branch from 63e8be1 to faeba21 Compare January 7, 2026 00:14
@kubaflo
Copy link
Contributor

kubaflo commented Jan 7, 2026

PR title and description might need some changes as it went from 7 to 5 phases

@PureWeen
Copy link
Member

PureWeen commented Jan 7, 2026

@copilot can you fix the title and description to represent all the latest changes

Copy link
Contributor Author

Copilot AI commented Jan 7, 2026

@copilot can you fix the title and description to represent all the latest changes

Updated the PR description to reflect the current state:

  • Changed from 7-phase to 5-phase workflow (Pre-Flight → Tests → Gate → Fix → Report)
  • Added the new try-fix skill which iteratively proposes and tests independent fix approaches
  • Updated all skill descriptions to match current implementations

For the title, I'd suggest: "Introduce consolidated 5-phase PR agent workflow with try-fix skill" - I cannot modify the title directly.

Copilot AI changed the title Introduce consolidated 7-phase PR agent workflow Introduce consolidated 5-phase PR agent workflow with try-fix skill Jan 7, 2026
- Replace 'Issue Resolver Agent' and 'PR Reviewer Agent' with unified 'PR Agent'
- Update phase count from 7 to 5 (Pre-Flight, Tests, Gate, Fix, Report)
- Add agents/pr/post-gate.md to agent files list
- Add Skills section documenting try-fix, verify-tests-fail-without-fix, write-tests, pr-build-status
- Add missing instruction files (agents, skills, helix-device-tests)
- Update metrics and last updated date to 2026-01-07
- Remove reference to non-existent agents/README.md
@PureWeen PureWeen marked this pull request as ready for review January 7, 2026 18:51
Copilot AI review requested due to automatic review settings January 7, 2026 18:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a major consolidation of the agent workflow, replacing two separate agents (issue-resolver and pr-reviewer) with a unified 5-phase pr agent that provides structured, end-to-end assistance for investigating issues and working on pull requests.

Key Changes

  • Unified PR Agent: Introduces a sequential 5-phase workflow (Pre-Flight → Tests → Gate → Fix → Report) tracked in state files
  • try-fix Skill: New skill for exploring independent fix approaches with empirical testing and failure analysis
  • Skills Framework: Adds reusable skills (write-tests, verify-tests-fail-without-fix, try-fix) that agents can invoke
  • Enhanced Testing: Scripts now support -Rebuild parameter for clean builds during test verification

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
.github/agents/pr.md Main PR agent covering phases 1-3 (Pre-Flight, Tests, Gate) with comprehensive workflow instructions
.github/agents/pr/post-gate.md Phases 4-5 (Fix, Report) including try-fix orchestration and final recommendations
.github/agents/pr-reviewer.md Removed - functionality consolidated into pr agent
.github/agents/issue-resolver.md Removed - functionality consolidated into pr agent
.github/agents/uitest-coding-agent.md Updated to reference pr agent instead of deprecated agents
.github/skills/try-fix/SKILL.md New skill for proposing and testing independent fix approaches with learning from failures
.github/skills/write-tests/SKILL.md New skill for creating UI tests following MAUI conventions with verification
.github/skills/verify-tests-fail-without-fix/SKILL.md New skill documentation for test verification
.github/skills/verify-tests-fail-without-fix/scripts/verify-tests-fail.ps1 Auto-detects mode based on git diff, verifies tests FAIL without fix and PASS with fix
.github/instructions/agents.instructions.md New guidelines for authoring custom agents (constraints, best practices, anti-patterns)
.github/instructions/skills.instructions.md New standards for skill development (structure, naming, script organization)
.github/instructions/sandbox.instructions.md Updated references from deprecated agents to pr agent
.github/instructions/collectionview-handler-detection.instructions.md Expanded with platform-specific guidance clarifying Items/ vs Items2/ usage
.github/scripts/BuildAndRunHostApp.ps1 Added -Rebuild switch parameter for clean builds
.github/scripts/shared/Build-AndDeploy.ps1 Added -Rebuild switch that passes --no-incremental to dotnet build
.github/copilot-instructions.md Updated agent list and delegation examples to reference pr agent
.github/README-AI.md Comprehensive update reflecting new agent structure and skills framework

```bash
# Identify the PR's fix files from the state file "Files Changed" section
# Revert ALL fix files (not test files)
git checkout HEAD~1 -- src/path/to/fix1.cs src/path/to/fix2.cs
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The git command git checkout HEAD~1 -- src/path/to/fix1.cs will revert the file to the commit before HEAD, not to the base branch. This could cause issues if:

  1. The PR has multiple commits with changes to the same file
  2. The file was changed in commits other than the most recent one

The script should use the base branch (which is detected/provided) instead of HEAD~1. Consider using the $BaseBranch variable that's mentioned in the Inputs section (line 41) or detecting it from the state file's "Files Changed" section.

Suggested change
git checkout HEAD~1 -- src/path/to/fix1.cs src/path/to/fix2.cs
git checkout "$BaseBranch" -- src/path/to/fix1.cs src/path/to/fix2.cs

Copilot uses AI. Check for mistakes.
- User: "Review PR #12345" → Immediately invoke **pr** agent
- User: "Test this PR" → Immediately invoke **sandbox-agent**
- User: "Fix issue #67890" → Immediately invoke **issue-resolver** agent
- User: "Fix issue #67890" (no PR exists) → Suggest using `/delegate` command
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an inconsistency in guidance for handling "fix issue" requests when no PR exists:

  • Line 210 in copilot-instructions.md says: "Fix issue #67890 (no PR exists) → Suggest using /delegate command"
  • Line 167 in sandbox.instructions.md says: "fix issue #XXXXX (no PR exists) → Suggest /delegate command"

However, the pr agent description (line 187 in copilot-instructions.md) says:
"Use when: A PR already exists and needs review or work, OR an issue needs a fix"

And the pr agent trigger phrases include "fix issue #XXXXX" (line 189).

This creates confusion: Should "fix issue" delegate to the pr agent, or suggest the /delegate command? The delegation policy (line 205) says to "ALWAYS delegate to the appropriate agent immediately" when trigger phrases match, but the examples contradict this.

Recommendation: Either the pr agent should handle "fix issue" for issues without PRs, OR the trigger phrases should clarify it only applies when a PR exists. The examples should align with the actual behavior.

Suggested change
- User: "Fix issue #67890" (no PR exists) → Suggest using `/delegate` command
- User: "Fix issue #67890" (no PR exists) → Immediately invoke **pr** agent

Copilot uses AI. Check for mistakes.
- Replace non-existent appium-control.instructions.md with uitests.instructions.md
- Fix UI tests workflow path from .github/workflows/ to eng/pipelines/
@PureWeen PureWeen merged commit a08a2ce into main Jan 7, 2026
3 of 4 checks passed
@PureWeen PureWeen deleted the copilot/merge-changes-from-pr-9 branch January 7, 2026 20:13
kubaflo pushed a commit to kubaflo/maui that referenced this pull request Jan 7, 2026
…otnet#33398)

Introduces a consolidated 5-phase PR agent workflow that provides
structured, end-to-end assistance for investigating issues, developing
fixes, and creating pull requests.

### PR Agent Workflow

The new `pr` agent replaces the separate `issue-resolver` and
`pr-reviewer` agents with a unified 5-phase workflow:

1. **Pre-Flight** - Context gathering and state file creation
2. **Tests** - Create or verify reproduction tests using the
`write-tests` skill
3. **Gate** - Verify tests catch the issue (mandatory checkpoint before
proceeding)
4. **Fix** - Explore and test fix approaches using the `try-fix` skill
5. **Report** - Present findings and create PR (with explicit user
confirmation)

### Agent Changes
- **Removed**: `issue-resolver.md`, `pr-reviewer.md`
- **Added**: `pr.md` - Main agent with phases 1-3 (Pre-Flight, Tests,
Gate)
- **Added**: `pr/post-gate.md` - Phases 4-5 (Fix, Report)

### New Skills
- `try-fix/` - Proposes ONE independent fix approach per invocation,
applies it, runs tests, records result with failure analysis, then
reverts. Learns from prior attempts. Max 5 attempts per session.
- `verify-tests-fail-without-fix/` - Auto-detects fix files from git
diff, verifies tests FAIL without fix and PASS with fix
- `write-tests/` - Creates UI test pages and NUnit tests following MAUI
conventions, with verification that tests reproduce the bug

### New Instructions
- `agents.instructions.md` - Copilot CLI agent authoring guidelines
(constraints, best practices, anti-patterns)
- `skills.instructions.md` - Skill development standards (structure,
naming, script organization)

### Script Updates
- Added `-Rebuild` parameter to `BuildAndRunHostApp.ps1` and
`Build-AndDeploy.ps1` for clean builds during test verification

### Documentation Updates
- Updated references from `issue-resolver`/`pr-reviewer` to `pr` agent
across README-AI.md, copilot-instructions.md, sandbox.instructions.md,
uitest-coding-agent.md
- Expanded `collectionview-handler-detection.instructions.md` with
platform-specific guidance (Items2/ is iOS/MacCatalyst only, Items/ is
the only Android/Windows implementation)

<!-- START COPILOT CODING AGENT SUFFIX -->



<!-- START COPILOT ORIGINAL PROMPT -->



<details>

<summary>Original prompt</summary>

> Create a PR with all the changes from this PR on the PureWeen fork
PureWeen#9


</details>



<!-- START COPILOT CODING AGENT TIPS -->
---

💬 We'd love your input! Share your thoughts on Copilot coding agent in
our [2 minute survey](https://gh.io/copilot-coding-agent-survey).

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: PureWeen <[email protected]>
Co-authored-by: Shane Neuville <[email protected]>
@kubaflo kubaflo added the area-ai-agents Copilot CLI agents, agent skills, AI-assisted development label Jan 28, 2026
@kubaflo kubaflo added the copilot label Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-ai-agents Copilot CLI agents, agent skills, AI-assisted development copilot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants